<!--
 * @Author: [kangjie]
 * @Date: 2022-04-08 15:12:42
 * @LastEditors: [kangjie]
 * @LastEditTime: 2022-04-08 15:26:07
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/axios-0.20.0.js"></script>
  <script src="./js/qs-6.9.4.js"></script>
</head>
<body>
  <script>
    let qs=Qs;
    // 请求拦截器
    axios.interceptors.request.use(config => {
     console.log(config);
     if(config.method == 'post' && config.url != 'http://121.199.0.35:8888/user/login'){
        config.data = qs.stringify(config.data)
     }  
    // Do something before request is sent
    return config;
    },error => {
    // Do something with request error
    return Promise.reject(error);
    });
    axios.post(
      "http://121.199.0.35:8888/index/carousel/findAll",
      {id:1,username:'张三'}
    );
    axios.post(
      "http://121.199.0.35:8888/user/login",
      {id:1,username:'张三'}
    )
  </script>
</body>
</html>